<?php

// Admin pages have a custom header/footer

pref('[Loop]/views/pathToSnippetFooter.html', '/[Loop]/Html/Snippet.Admin.Footer.html');
pref('[Loop]/views/pathToSnippetHeader.html', '/[Loop]/Html/Snippet.Admin.Header.html');


// Get variables

$directory = fv('directory', true);
$extensionId = fv('extensionId', true);
$fileToTranslate = fv('file', true);


// Dependencies

require_once(PATH_LOOP . 'Class/CDocumentation.php');


// Create an object documentation

$documentationFactory = new \Loop\CDocumentation();


// Get the documentation

$result = $documentationFactory->generate($extensionId, $fileToTranslate, $directory);


// Prepare variables for the view

v('directory', $directory);
v('extensionId', $extensionId);
v('fileToTranslate', $fileToTranslate);
v('result', $result);

?>